<%@page pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
		<title>人员排序</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
INPUT {
	FONT-SIZE: 12px;
	COLOR: #000000;
	FONT-FAMILY: "Verdena";
	HEIGHT: 18px;
	padding: 1px;
	border: 1px solid #A2A4BD;
}
-->
</style>
</head>
<base target="_self"/>
<% if(request.getAttribute("result")!=null && request.getAttribute("result").toString().equals("OK")) {%>
<script language="javascript">
//向父窗口返回的值
window.returnValue = "这是子窗口返回来的值,需要刷新父窗口";
window.close();
</script>
<% } %>
<jsp:include page="../common/init.jsp"></jsp:include>
<SCRIPT>
//验证排序号是否为数字
function validatePxh(id)
{	
	var checkId="pxh_"+id;
	var checkValue=document.getElementById(checkId).value;
	var errorDivId="pxhDiv_"+id;
	var errorImgId="pxhImg_"+id;
	if(checkNullValue(checkValue))
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"排序号不能为空!");
		return false;
	}
	else if(!isInt(checkValue))
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"排序号必须为正整数!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//提交
function doSubmit()
{
	var flag = true;
	for(var i=0;i<document.getElementsByName("pxh").length;i++)
	{
		flag=validatePxh(i);
		if(!flag)
		{
			break;
		}
	}
	if(flag)
	{
		document.forms[0].action="orderRyjbxx.do";
		document.forms[0].submit();	
	}
	else
	{
		return false;
	}
}
//提示信息
function showMessage(){
	var message="<%=request.getAttribute("info")%>";
	if(message != "null" && message != ""){
		document.getElementById('errorDivCreateWzbm').innerHTML='提示:<span style="font-size:12px;color:#ff0000">' + message + '</span>';
		document.getElementById('errorDivCreateWzbm').style.display="inline";
		document.getElementById('errorDivCreateWzbm').focus();
	}
}

//页面关闭
function winClose()
{
	//window.returnValue = "ok";
	window.close();
}
//生成功能按钮	
mpmenu1=new mMenu('','winClose()','script','<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_44.gif','62','24','0','100','2');
</script>
<%
 response.setHeader("Cache-Control","no-store");
 response.setDateHeader("Expires", 0);
 response.setHeader("Pragma","no-cache"); 
%>
<body onload="showMessage()">
<s:form action="">
<table cellspacing="0" cellpadding="0" class="main_tab1" onclick="javascript: mouseClick('errorDivCreateWzbm');">
    <tr>
        <td rowspan="4" class="main_tab1_td8">&nbsp;</td>
        <td class="main_tab1_td1"><img src="<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_28.gif" alt="left" /></td>
        <td class="main_tab1_td2">
		<div id="location">人员排序</div>
		<div id="funbut">
			<SCRIPT>document.write(mwritetodocument());</SCRIPT>
		</div>
		</td>
        <td class="main_tab1_td1"><img src="<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_32.gif" alt="right" /></td>
    </tr>
	<tr >
		<td colspan="3" align="left" height="25" bgcolor="#ffffff">
		<div id="errorDivCreateWzbm"></div>
		</td>
	</tr>
    <tr>
        <td colspan="3" class="main_tab1_td3" bordercolor="#ffffff">
		<div id="mainbg" style="overflow:scroll;width:100%;height:230px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="main_tab2">
    <tr height="30">
        <th>姓名</th>
        <th>职务</th>
        <th>排序号</th>
    </tr>
    <s:set name="cssClass"  value="'main_tab2_td1'"></s:set>
	<s:iterator  value="ryxxList" status="index">
	<s:if test="#index.index%2==0">
	<s:set name="cssClass"  value="'main_tab2_td1'"></s:set>
	</s:if>
	<s:else>
	<s:set name="cssClass"  value="'main_tab2_td2'"></s:set>
	</s:else>
	<tr valign="bottom" class="<s:property value="#cssClass"/>">
			<td align="left" valign="bottom" width="100" height="25">
				&nbsp;
				<s:if test="xm.length()>10">
					<s:property  value="xm.substring(0,10)" />...
				</s:if>
				<s:else>
					<s:property  value="xm" />
				</s:else>
				<input type="hidden" name="orderRybhs" value="<s:property  value="rybh" />" />
			</td>
			<td align="left" valign="bottom" width="100" height="25">
			&nbsp;<s:property  value="zw" />
			</td>
			<td align="left" valign="bottom">&nbsp;
			<input type="text" id="pxh_<s:property  value="#index.index" />" name="pxh" value="<s:property  value="pxh" />" size="2"
							maxLength="3" onclick="javascript: mouseClick('pxhDiv_<s:property  value="#index.index" />')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validatePxh(<s:property  value="#index.index" />);" >
						 &nbsp;
				<img src="" id="pxhImg_<s:property  value="#index.index" />" style="display:none;"/>
				<div id="pxhDiv_<s:property  value="#index.index" />" style="background:#008080;display:none;cursor:default"/>
			</td>
		</tr>
	</s:iterator>
</table>
		</div>
			<div class="butk">
<div class="btn_01">
<a href="#" onclick="doSubmit()">保&nbsp;存</a>
</div>
</div>
		</td>
    </tr>    
</table>
</s:form>
</body>
</html>
